//
//  ManageAddressViewController.m
//  share_business
//
//  Created by baidufz on 2017/9/3.
//  Copyright © 2017年 wyl. All rights reserved.
//

#import "ManageAddressViewController.h"
#import "EditAddressViewController.h"
#import "AddressCell.h"

@interface ManageAddressViewController ()
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UIButton *addNewAddressBtn;

@end

@implementation ManageAddressViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self registerCell];
    [self initManageAddress];
}

- (void)initManageAddress {
    self.navigationItem.title = @"地址管理";
    _addNewAddressBtn.layer.borderColor = [UIColor orangeColor].CGColor;
    _addNewAddressBtn.layer.borderWidth = 1.0f;
    _addNewAddressBtn.layer.cornerRadius = 3.0f;
    _addNewAddressBtn.layer.masksToBounds = YES;
    [_addNewAddressBtn addTarget:self action:@selector(addNewAddress) forControlEvents:UIControlEventTouchUpInside];
}

- (void)registerCell {
    NSString *cellID = NSStringFromClass([AddressCell class]);
    [_tableView registerNib:[UINib nibWithNibName:cellID bundle:nil] forCellReuseIdentifier:cellID];
}

- (void)addNewAddress {
    [self.navigationController pushViewController:[EditAddressViewController new] animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
